Quick Navigation All projects Hardware Links Top projectsAlan numitron clock Clapclap 2313/1386 SNES Pi Webserver USB Volume/USB toys Smokey amp Laser cutter WordClock ardReveil v3 SNES Arcade cabinet Game boy projects cameleon Home Presence Detector GitHubAlanFromJapan Contact me![]() Who's Alan?Akizukidenshi Elec-lab Rand Nerd Tut EEVblog SpritesMods AvrFreaks Gameboy Dev FLOZz' blog Switch-science Sparkfun Suzusho Datasheet Lib Reddit Elec Ermicro Carnet du maker (fr) |
another raspi webradio playerLast update: Sat Jan 10 23:04:53 2026
This is a new Template for another raspi webradio player!
PresentationPrinciplePoints of interrestImplementationInstallation#Start with a fresh Raspberry pi OS sudo apt update sudo apt upgrade #get the screen to work sudo apt install git emacs-nox libxi6 git clone https://github.com/waveshare/LCD-show.git cd LCD-show/ ./LCD35-show reboot #test the screen cat /dev/urandom >/dev/fb0 #get pygame sudo apt install python3-pip sudo pip3 install pygame #get SDL library 1.2 (https://www.impulseadventure.com/elec/rpi-install-sdl.html) sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev #VLC and pulseaudio sudo apt-get install vlc pulseaudio TestingRun that file AS SUDOER:
import pygame
import sys
import time
import os
drivers = ['directfb', 'fbcon', 'svgalib']
found = False
for driver in drivers:
if not os.getenv('SDL_VIDEODRIVER'):
os.putenv('SDL_VIDEODRIVER', driver)
try:
pygame.display.init()
except pygame.error:
print ('Driver: {0} failed.'.format(driver))
continue
found = True
break
if not found:
raise Exception('No suitable video driver found!')
pygame.init()
size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
black = 0, 0, 0
screen = pygame.display.set_mode(size)
screen.fill(black)
pygame.display.flip()
time.sleep(5)
Bill of materialsSchematicsSource codePicturesLinksHelpful sourcesInspiration |
|
All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated) electrogeek.tokyo ~ Formerly known as Kalshagar.wikispaces.com and electrogeek.cc (AlanFromJapan [2009 - 2026]) |
|